<?php
class Con_fy extends Acan{
	public $defaultAct='fy';
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
	}
	function Act_fy(){
		global $_G;
		$navtitle = "在线翻译_英译中_中译英";
		if($_POST){
			if($_POST['fy']=='google'){
				$url = "http://translate.google.cn/translate_a/t?client=t&text=".urlencode($_POST['content'])."&hl=".$_POST['hl']."&sl=".$_POST['sl']."&tl=".$_POST['tl'];
				$ch = curl_init();
				curl_setopt($ch, CURLOPT_URL, $url);
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
				// 我们在POST数据哦！
				curl_setopt($ch, CURLOPT_GET, 1);
				$output = curl_exec($ch);
				curl_close($ch);
				echo Afun_charset($output,'utf8','text/javascript');
				return;
			}
			$url = "http://fy.iciba.com/interface.php";
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $url);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			// 我们在POST数据哦！
			curl_setopt($ch, CURLOPT_POST, 1);
			// 把post的变量加上
			curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
			$output = curl_exec($ch);
			curl_close($ch);
			echo $output;
			return;
		}
		include $this->Atpl();
	}
}
?>